package nc.itf.arap.cbfx.service.impl;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.bs.framework.server.ServerConfiguration;
import nc.cbfx.itf.comm.ItfLogVO;
import nc.itf.arap.cbfx.service.IAsynLogService;

public class AsynLogImpl implements IAsynLogService {

	@Override
	public void insertLog_RequiresNew(ItfLogVO operateLogVO) {
		try {
			getBaseDAO().insertVO(operateLogVO);
		} catch (DAOException e) {
			e.printStackTrace();
		}
	}

	private BaseDAO baseDAO;

	public BaseDAO getBaseDAO() {
		if (baseDAO == null) {
			String dataSourceName = ServerConfiguration.getServerConfiguration().getDataSourceNames()[0];
			baseDAO = new BaseDAO(dataSourceName);
		}
		return baseDAO;
	}

}
